package com.drg.center.entity.param;

import com.guaike.core.entity.annotation.ConditionBy;
import com.guaike.core.entity.annotation.IsEnumValue;
import com.guaike.core.entity.enums.DataPermissonTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;

/**
 * @Author: zhangxilin
 * @Date: 2024/5/22
 */
@Data
@ApiModel("添加用户DTO")
public class SysUserAddDTO implements Serializable {

    @ApiModelProperty("账号")
    @NotBlank(message = "账号不能为空")
    private String username;

    @ApiModelProperty("密码")
    @NotBlank(message = "密码不能为空")
    private String password;

    @ApiModelProperty("真实姓名")
    @NotBlank(message = "真实姓名不能为空")
    private String realName;

    @ApiModelProperty("联系电话")
    @NotBlank(message = "联系电话不能为空")
    private String phone;

    @ApiModelProperty("所属部门ID")
    private String deptCode;

    @ApiModelProperty("数据权限规则(字典码:10004)")
    @IsEnumValue(clazz = DataPermissonTypeEnum.class, column = "code", ignoreNull = true, message = "数据权限规则传参不合法")
    private Integer scopeType;

    @ApiModelProperty("可以查看数据权限的部门ID集合(dataScopeType==0时传)")
    @ConditionBy(column = "scopeType", columnValue = {"0"}, message = "请选择可查看数据权限的部门")
    private List<String> scopeDeptCodeList;

    @ApiModelProperty("角色ID集合")
    private List<Long> roleIdList;

    @ApiModelProperty("岗位ID集合")
    private List<Long> positionIdList;

    @ApiModelProperty("丛属部门ID集合")
    private List<String> deptCodeList;

}
